const app = getApp();
const AJAX = app.$ajax,
  $wx = app.$wx;

Page({
  onLoad(options){
    this.setData({
      currentScore: options.current_score
    });
    this.getScore();
  },

  onShareAppMessage(){
    
  },

  getScore(page){
    AJAX.getScore({
      loadType: 'bar',
      page
    }).then(([status, res, msg]) => {
      if(status){
        this.setData({
          score: res.data
        });
      }else{
        $wx.showToast(msg);
      }
    });
  }
});